<div id="permalink-msg">
  <div class="screen">
    <div class="alert alert-success">
      <strong>Permalink copied!</strong> 
    </div>
  </div>
</div>
<div class="chapter-content">

  <div class="chapter-title">
    <div class="permalink">
      <a name="top" class="permalink"><%= @title %></a>
    </div>
  </div>
    <div class="chapter-text" >
        <%= raw @html_doc %>
    </div>

    <div class="nav">

    <% if (@chapter.id > 1) %>
        <button type="button" class="btn btn-secondary" style="background-color: #fff;">
          <%= link_to  "< Previous", chapter_url(@chapter.id - 1) %>
        </button>
    <% end %>

    <div style="flex-grow: 1;"></div>
    
    <% if (@chapter.id < Chapter.count) %>
        <button type="button" class="btn btn-secondary" style="background-color: #fff;">
          <%= link_to  "Next >", chapter_url(@chapter.id + 1), :class => "scroll-next"  %>
        </button>
    <% end %>

    <% if (@chapter.id >= Chapter.count) %>
        <div>
          <%= link_to  "", 'e', :class => "scroll-next"  %>
        </div>
    <% end %>

  </div>
  <div class="chapter_sign">
        <%= @title %>
    </div>
  <%= javascript_tag "var chapter_id = #{@chapter.id};" %>
  <div class="next-page"></div>
</div>
